#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int a[N];
long long ans;
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n;
	int tmp;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&tmp);
		a[tmp]++;
	}
	tmp=0;
	while(a[tmp]==0) tmp++;
	for(int i=tmp;i<=n;i++){
		if(a[i]==0) continue;
		else{
			ans+=a[tmp];
			if(a[i]>=ans){
				ans=0;
			}
			else{
				ans-=a[i];
			}
			tmp=i;
		}
	}
	ans+=a[tmp];
	printf("%lld\n",ans);
	return 0;
}
